import tkinter as tk
from tkinter import messagebox, ttk

def show_notification(title, message, category=None):
    """显示非阻塞提醒弹窗"""
    notification = tk.Toplevel()
    notification.title(f"Reminder: {title}")
    notification.geometry("350x150")
    notification.attributes("-topmost", True)  # 置顶
    
    # 标题
    ttk.Label(notification, text=title, font=("Arial", 14, "bold")).pack(pady=10)
    
    # 消息
    ttk.Label(notification, text=message, wraplength=300).pack(pady=5)
    
    # 分类
    if category:
        ttk.Label(notification, text=f"Category: {category}", foreground="blue").pack(pady=2)
    
    # 按钮
    ttk.Button(notification, text="OK", command=notification.destroy).pack(pady=10)
    
    # 5秒后自动关闭
    notification.after(5000, notification.destroy)
    
    # 保持在最前面
    notification.focus_force()
    notification.grab_set()